﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;

namespace Dala.Utilities
{
    public class SiteUtility
    {
        public static string SiteBaseUrl
        {
            get
            {
                //return ConfigurationManager.AppSettings["RootPath"].ToString(); 
                string orginalUrl = HttpContext.Current.Request.Url.AbsoluteUri;
                if (HttpContext.Current.Request.Url.Query.Length > 0)
                    orginalUrl = orginalUrl.Replace(HttpContext.Current.Request.Url.Query, string.Empty);

                return orginalUrl.Replace(HttpContext.Current.Request.Url.AbsolutePath, string.Empty) + ((HttpContext.Current.Request.ApplicationPath == "/" ? "" : HttpContext.Current.Request.ApplicationPath)) + '/';
            }

        }
    }
}
